#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<math.h>

using namespace std;
bool isPrime(int& input)
{
	for (int i = 2; i < sqrt(input); ++i)
	{
		if (input % i == 0)
			return false;
	}
	return true;
}
int main()
{
	int input;
	cin >> input;
	int right = input / 2;
	for (; right <= input; ++right)
	{
		int left = input - right;
		if (isPrime(left) && isPrime(right))
		{
			cout << left << endl << right << endl;
			break;
		}
	}
	return 0;
}